﻿using System;
using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.club
{
    public class ClubPlayerStateChange : Message
    {
        public static int TYPE = 7;
        public static int ID = 49;

        private int _changeState;  //0 退出俱乐部  1 正常状态改变  2 新加俱乐部
        private string _avatar;    //头像地址
        private string _name;      //名字
        private int _state;    //1 离线 2等待 3游戏中
        private int _id;           //玩家ID

        public int ChangeState
        {
            get
            {
                return _changeState;
            }

            set
            {
                _changeState = value;
            }
        }

        public string Avatar
        {
            get
            {
                return _avatar;
            }

            set
            {
                _avatar = value;
            }
        }

        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                _name = value;
            }
        }

        public int State
        {
            get
            {
                return _state;
            }

            set
            {
                _state = value;
            }
        }

        public int Id
        {
            get
            {
                return _id;
            }

            set
            {
                _id = value;
            }
        }

        public void decode(Input _in)
        {
            ChangeState = _in.readInt();
            Avatar = _in.readString();
            Name = _in.readString();
            State = _in.readInt();
            Id = _in.readInt();
        }

        public void encode(Output _out)
        {
        }
        
        public int getMessageType()
        {
            return TYPE;
        }

        public int getMessageId()
        {
            return ID;
        }

        public string toString()
        {
            return string.Format("changeState={0},  avatar= {1}, name={2} , state= {3}, id= {4}",_changeState,_avatar,_name,_state,_id);
        }
    }
}